package com.muchfish.reactor.api;

import reactor.core.publisher.Flux;

public class ReactorConcatWithExample {
    public static void main(String[] args) {
        Flux<Integer> source1 = Flux.just(1, 2, 3);
        Flux<Integer> source2 = Flux.just(4, 5, 6);

        // 将两个数据流连接在一起，保持顺序
        source1.concatWith(source2)
                .subscribe(System.out::println);
    }
}
